home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / makmenu2.zip / MAKMENU2.DOC < prev    next >
Text File  |  1989-08-09  |  5KB  |  123 lines

  1.  
  2.  
  3.                MAKMENU2 - A QB4.X BAR MENU FUNCTION
  4.  
  5.                            William Baer
  6.                          Albuquerque,  NM
  7.                            August, 1989
  8.  
  9.  
  10. I.  INTRODUCTION
  11.  
  12.     MAKMENU2 is a QuickBasic 4.x function to create a vertical
  13. bar menu, make a choice of the options displayed on the menu and
  14. then return the value of the position of the moving bar (1 to N)
  15. to the calling program.  This function is a modification of one
  16. which I downloaded from a BBS sometime last year, and I cannot find
  17. the original ZIP file to give credit to the author.  I have made
  18. some simplifications to his original routine and added some bells
  19. and whistles to it.  In any event, since I didn't do all the hard
  20. work, the function is freeware and you are welcome to use it as you
  21. see fit.
  22.  
  23. II. FUNCTION DESCRIPTION
  24.  
  25.         A.  Function Call
  26.  
  27.         MAKMENU2 is called by the following statement.
  28.  
  29.         Option%=Makmenu2%(Choozit$(),NumofChoices%,LeftCol%,Row%,_
  30.         fg%,bg%,fgl%,hfg%,hbg%)
  31.  
  32.  
  33.         B.  Description of Variables
  34.  
  35.         Choozit$() - A string array of the descriptions of the
  36.         options to be executed.  The number of these variables
  37.         must be <= 23.
  38.  
  39.         NumofChoices% - An integer variable giving the number of
  40.         options described by Choozit$.  Its value must be <= 23
  41.         and >= 2.
  42.  
  43.         LeftCol% - An integer variable specifying the column in
  44.         which to start the display of option descriptions.
  45.  
  46.         Row% - An integer variable specifying the row on which to
  47.         start the display of option descriptions.
  48.  
  49.         fg% - An integer variable specifying the foreground color
  50.         used to display the option descriptions.
  51.  
  52.         bg% - An integer variable specifying the background color
  53.         used to display the option descriptions.
  54.  
  55.         fgl% - An integer variable specifying the foreground
  56.         color used to display the first letter of each option
  57.         description and the sequence number of each option if the
  58.         number of options is <=10.
  59.  
  60.  
  61.  
  62.                                 -2-
  63.  
  64. II.B. (Cont'd)
  65.         
  66.         hfg% - An integer variable specifying the foreground
  67.         color of the highlight bar used to pick an option.
  68.  
  69.         bfg% - An integer variable specifying the background
  70.         color of the highlight bar used to pick an option.
  71.  
  72.  
  73. III.  FUNCTION OPERATION
  74.  
  75.         When MakMenu2 is called, a check is made to ensure that
  76.         the number of options is >=2 and <=23, and that the row
  77.         and column at which the option descriptions start will
  78.         allow the options to be displayed on the screen without
  79.         scrolling, etc.  If errors are found then the function is
  80.         exited without any error flag being set.
  81.  
  82.         If the number of option choices is <= 10, then the
  83.         option descriptions have a sequence number (1,2,3--0)
  84.         inserted before each description.  In this case, movement
  85.         of the option selection bar can be made by hitting the
  86.         the number keys, the first letter of each option or by
  87.         using the Up/Down, PgUp, PgDn, Home or End keys.
  88.  
  89.         If the number of option choices is >10, the no sequence
  90.         numbers are available to make a choice.
  91.  
  92.         Obviously each option description must have a different
  93.         starting character.  If two options start with the same
  94.         character, then using that character to pick an option
  95.         will only allow the first of these options to be picked.
  96.         Choosing an option by specifying the first character is
  97.         done by sorting an array of these first characters which
  98.         are extracted from the option descriptions.  I have
  99.         included a simple string sort routine, but you can
  100.         replace it with any other one that pleases you.
  101.  
  102.         If an illegal key is struck, the function beeps and the
  103.         option choice bar remains at its current location.
  104.  
  105. IV.  MAKMENU2 DEMO PROGRAM
  106.  
  107.         I have included a very simple example named TESTMENU of
  108.         the use of MAKMENU2.  Both the QBasic source and the
  109.         compiled program are contained in the ZIP file.  In real
  110.         use, MAKMENU2 should be combined with your favorite
  111.         QBasic window routines to make things look elegant!
  112.  
  113. V.  MISCELLANEOUS
  114.  
  115.         If you have any questions, you can leave a message at one
  116.         of the BBS' listed below.
  117.  
  118.         Channel 1               (617)-354-8873
  119.         Microsellar             (201)-239-1346
  120.         Computer Connection     (202)-547-2008
  121.         PC Network              (505)-821-5341
  122.                                               
  123.